Skip to content

BUG: value_counts can handle the case even with empty groups (#28479) #28608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

dongho-jung
Copy link
Contributor

  • If applying rep to recons_labels go fail, use ids which has no
    consecutive duplicates instead.

xuancong84 found that value_counts() crashes if groupby object contains empty groups.
However, even though I made the construction of DataFrame don't skip empty rows, it still crashed.
Till then, I already tried in many ways though, in this time I tried to correct the callee self.grouper.recons_labels. After several tests, I found that If freq of Grouper is too long so that it has empty groups in some periods then it crashes. And also have found that this is solved by using ids which has no consecutive duplicates instead of self.grouper.recons_labels.

…dev#28479)

    * If applying rep to recons_labels go fail, use ids which has no
      consecutive duplicates instead.
@dongho-jung
Copy link
Contributor Author

Why did they go fail..?? I have never changed any contents of test_categorical.py though... and apart from me, he also has the same problem. #28595

Is there any problem with CI now?

@dongho-jung
Copy link
Contributor Author

I closed this issue because of CI issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

value_counts() crashes if groupby object contains empty groups
1 participant